package com.quaidi.smartlocker.common;

/**
 * 响应状态码枚举
 * 
 * @author QuaiDi
 * @since 2025-08-26
 */
public enum ResultCode {

    /**
     * 成功
     */
    SUCCESS(200, "操作成功"),

    /**
     * 失败
     */
    ERROR(500, "操作失败"),

    /**
     * 参数错误
     */
    PARAM_ERROR(400, "参数错误"),

    /**
     * 未授权
     */
    UNAUTHORIZED(401, "未授权"),

    /**
     * 禁止访问
     */
    FORBIDDEN(403, "禁止访问"),

    /**
     * 资源未找到
     */
    NOT_FOUND(404, "资源未找到"),

    /**
     * 柜格相关状态码
     */
    COMPARTMENT_NOT_AVAILABLE(1001, "柜格不可用"),
    COMPARTMENT_NOT_FOUND(1002, "柜格不存在"),
    COMPARTMENT_ALREADY_OCCUPIED(1003, "柜格已被占用"),

    /**
     * 包裹相关状态码
     */
    PACKAGE_NOT_FOUND(2001, "包裹不存在"),
    PACKAGE_ALREADY_PICKED_UP(2002, "包裹已被取走"),
    PACKAGE_EXPIRED(2003, "包裹已过期"),
    INVALID_PICKUP_CODE(2004, "取件码无效"),

    /**
     * 快递公司相关状态码
     */
    EXPRESS_COMPANY_NOT_FOUND(3001, "快递公司不存在"),
    EXPRESS_COMPANY_DISABLED(3002, "快递公司已禁用");

    /**
     * 状态码
     */
    private final Integer code;

    /**
     * 状态消息
     */
    private final String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}